package com.comando.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * ArticleT entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "article_t", catalog = "qunar")
public class ArticleT implements java.io.Serializable {

	// Fields

	private Long articleId;
	private UserT userT;
	private ChannelT channelT;
	private Integer groupLevel;
	private String title;
	private String shortTitle;
	private String contentImg;
	private String contentHtml;
	private String description;
	private String tags;
	private Timestamp createTime;
	private Timestamp modifyTime;
	private Long visitTotal;
	private String contentResPath;
	private Integer commentCount;
	private Boolean hasTitleimg;
	private Boolean allowComment;
	private Boolean isRecommend;
	private Integer support;
	private Integer unsupport;
	private Boolean state;
	//private Set<CommentT> commentTs = new HashSet<CommentT>(0);

	// Constructors

	/** default constructor */
	public ArticleT() {
	}

	/** minimal constructor */
	public ArticleT(ChannelT channelT, Timestamp createTime,
			Timestamp modifyTime, Long visitTotal, Integer commentCount,
			Boolean hasTitleimg, Boolean allowComment, Boolean isRecommend,
			Boolean state) {
		this.channelT = channelT;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
		this.visitTotal = visitTotal;
		this.commentCount = commentCount;
		this.hasTitleimg = hasTitleimg;
		this.allowComment = allowComment;
		this.isRecommend = isRecommend;
		this.state = state;
	}

	/** full constructor */
	public ArticleT(UserT userT, ChannelT channelT, Integer groupLevel,
			String title, String shortTitle, String contentImg,
			String contentHtml, String description, String tags,
			Timestamp createTime, Timestamp modifyTime, Long visitTotal,
			String contentResPath, Integer commentCount, Boolean hasTitleimg,
			Boolean allowComment, Boolean isRecommend, Integer support,
			Integer unsupport, Boolean state) {
		this.userT = userT;
		this.channelT = channelT;
		this.groupLevel = groupLevel;
		this.title = title;
		this.shortTitle = shortTitle;
		this.contentImg = contentImg;
		this.contentHtml = contentHtml;
		this.description = description;
		this.tags = tags;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
		this.visitTotal = visitTotal;
		this.contentResPath = contentResPath;
		this.commentCount = commentCount;
		this.hasTitleimg = hasTitleimg;
		this.allowComment = allowComment;
		this.isRecommend = isRecommend;
		this.support = support;
		this.unsupport = unsupport;
		this.state = state;
		//this.commentTs = commentTs;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ARTICLE_ID", unique = true, nullable = false)
	public Long getArticleId() {
		return this.articleId;
	}

	public void setArticleId(Long articleId) {
		this.articleId = articleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public UserT getUserT() {
		return this.userT;
	}

	public void setUserT(UserT userT) {
		this.userT = userT;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHANNEL_ID", nullable = false)
	public ChannelT getChannelT() {
		return this.channelT;
	}

	public void setChannelT(ChannelT channelT) {
		this.channelT = channelT;
	}

	@Column(name = "GROUP_LEVEL")
	public Integer getGroupLevel() {
		return this.groupLevel;
	}

	public void setGroupLevel(Integer groupLevel) {
		this.groupLevel = groupLevel;
	}

	@Column(name = "TITLE")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "SHORT_TITLE")
	public String getShortTitle() {
		return this.shortTitle;
	}

	public void setShortTitle(String shortTitle) {
		this.shortTitle = shortTitle;
	}

	@Column(name = "CONTENT_IMG", length = 100)
	public String getContentImg() {
		return this.contentImg;
	}

	public void setContentImg(String contentImg) {
		this.contentImg = contentImg;
	}

	@Column(name = "CONTENT_HTML", length = 5000)
	public String getContentHtml() {
		return this.contentHtml;
	}

	public void setContentHtml(String contentHtml) {
		this.contentHtml = contentHtml;
	}

	@Column(name = "DESCRIPTION")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "TAGS")
	public String getTags() {
		return this.tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	@Column(name = "CREATE_TIME", nullable = false, length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "MODIFY_TIME", nullable = false, length = 19)
	public Timestamp getModifyTime() {
		return this.modifyTime;
	}

	public void setModifyTime(Timestamp modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "VISIT_TOTAL", nullable = false)
	public Long getVisitTotal() {
		return this.visitTotal;
	}

	public void setVisitTotal(Long visitTotal) {
		this.visitTotal = visitTotal;
	}

	@Column(name = "CONTENT_RES_PATH", length = 200)
	public String getContentResPath() {
		return this.contentResPath;
	}

	public void setContentResPath(String contentResPath) {
		this.contentResPath = contentResPath;
	}

	@Column(name = "COMMENT_COUNT", nullable = false)
	public Integer getCommentCount() {
		return this.commentCount;
	}

	public void setCommentCount(Integer commentCount) {
		this.commentCount = commentCount;
	}

	@Column(name = "HAS_TITLEIMG", nullable = false)
	public Boolean getHasTitleimg() {
		return this.hasTitleimg;
	}

	public void setHasTitleimg(Boolean hasTitleimg) {
		this.hasTitleimg = hasTitleimg;
	}

	@Column(name = "ALLOW_COMMENT", nullable = false)
	public Boolean getAllowComment() {
		return this.allowComment;
	}

	public void setAllowComment(Boolean allowComment) {
		this.allowComment = allowComment;
	}

	@Column(name = "IS_RECOMMEND", nullable = false)
	public Boolean getIsRecommend() {
		return this.isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	@Column(name = "SUPPORT")
	public Integer getSupport() {
		return this.support;
	}

	public void setSupport(Integer support) {
		this.support = support;
	}

	@Column(name = "UNSUPPORT")
	public Integer getUnsupport() {
		return this.unsupport;
	}

	public void setUnsupport(Integer unsupport) {
		this.unsupport = unsupport;
	}

	@Column(name = "STATE", nullable = false)
	public Boolean getState() {
		return this.state;
	}

	public void setState(Boolean state) {
		this.state = state;
	}
/*
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "articleT")
	public Set<CommentT> getCommentTs() {
		return this.commentTs;
	}

	public void setCommentTs(Set<CommentT> commentTs) {
		this.commentTs = commentTs;
	}*/

}